﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using System.Data;
using DevExpress.XtraEditors;
using System.Windows.Forms;

using QLTTAN.BLL;
namespace QLTTAN.Report
{
    public partial class rpBaoCaoKeToan : DevExpress.XtraReports.UI.XtraReport
    {
        BaoCaoBLL BC_BLL;

        public rpBaoCaoKeToan()
        {
            InitializeComponent();

            lblNgayLap.Text = DateTime.Now.ToString();
        }

        public rpBaoCaoKeToan(DateTime thang)
        {
            InitializeComponent();

            BC_BLL = new BaoCaoBLL();

            lblNgayLap.Text = DateTime.Now.ToString("dd/MM/yyyy");
            lblThang.Text = thang.ToString("MM/yyyy");

            try
            {
                DataTable dt = BC_BLL.BaoCao_LoadBaoCaoKeToan(thang);
                this.DataSource = dt;
                this.DataMember = dt.TableName;
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "Thông báo!!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void rpBaoCaoKeToan_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            
        }

    }
}
